#include "stdafx.h"
#include "Fakes/FakeD3D10Resource.h"
#include "Fakes/FakeD3D10ShaderResourceView1.h"
#include "Fakes/FakeD3D10Device1.h"

DESCRIPTION_10_1_TEST_SUITE_CTOR(ShaderResourceViewDescription1, (D3D10_1_SRV_DIMENSION_BUFFER))

BOOST_FIXTURE_TEST_CASE(Default, TestShaderResourceViewDescription1)
{
	BOOST_REQUIRE_EQUAL(D3D10_1_SRV_DIMENSION_BUFFER, m_desc.ViewDimension);
	BOOST_REQUIRE_EQUAL(DXGI_FORMAT_UNKNOWN, m_desc.Format);
}

BOOST_FIXTURE_TEST_CASE(Create, TestShaderResourceViewDescription1)
{
	FakeD3D10Device1 device;
	FakeD3D10ShaderResourceView1 view;
	device.CreateShaderResourceView1FakeResult = &view;
	device.CreateShaderResourceView1FakeHResult = S_OK;
	FakeD3D10Resource resource;
	ID3D10ShaderResourceView1 *result = m_desc.Create(&device, &resource);
	BOOST_REQUIRE(device.CreateShaderResourceView1Called);
	BOOST_REQUIRE_EQUAL(&m_desc, device.CreateShaderResourceView1LastDesc);
	BOOST_REQUIRE_EQUAL(&resource, device.CreateShaderResourceView1LastResource);
	BOOST_REQUIRE_EQUAL(&view, result);
}

BOOST_AUTO_TEST_SUITE_END()
